{% extends 'layout/basic.html' %}
{% load static %}

{% block title %} 首页 {% endblock %}

{% block css %}
    <style>
        img {
            width: 100%;
        }
    </style>
{% endblock %}

{% block content %}

    <div class="container-fluid">
        <div class="panel panel-default">
            <div class="panel-heading"><i class="fa fa-fast-forward" aria-hidden="true"></i> 近期事项</div>
            <div class="panel-body">
                <div class="row">
                    {% for item in result %}

                    <a href="{{ item.2 }}">
                        <div class="col-xs-6 col-md-3" style="height: 200px;border: #0b1c2c solid 1px">
                            <div class="alert alert-info" role="alert">{{ item.0 }} —— {{ item.3 }}</div>
                            {{ item.1 }}
                        </div>
                    </a>
                    {% endfor %}



                </div>
            </div>
        </div>
    </div>
{% endblock %}

{% block js %}

    <script>
        function goDashboard() {
            window.location.href = "{% url 'project_list' %}";
        }

        {% comment %}let canvas = document.querySelector('canvas');
        let ctx = canvas.getContext('2d');
        canvas.width = window.innerWidth * 1;
        canvas.height = window.innerHeight * 0.85;
        let str = "makemestronger".split('');
        let arr = Array(Math.ceil(canvas.width / 10)).fill(0);
        let run = () => {
            ctx.fillStyle = 'rgba(0,0,0,0.05)';
            ctx.fillRect(0, 0, canvas.width, canvas.height);
            ctx.fillStyle = '#0f0';
            arr.forEach((item, index) => {
                ctx.fillText(str[Math.floor(Math.random() * str.length)], index * 10, item + 10);
                arr[index] = item > canvas.height || item > 10000 * Math.random() ? 0 : item + 10;
            });
        };
        // run()
        setInterval(run, 40);{% endcomment %}


        layui.use(['layer'], function (args) {
            var layer = layui.layer;
            layer.msg('TaskSaas')
        });

    </script>

{% endblock %}